package com.epfresh.supplier.entity;

import java.util.List;

public class PayInfo {
    // [ "alipay", "weChat" ]
    private int result;
    private String number;
    private double payAmount;
    private int receiptType;
    private List<String> channel;

    public static String ALIPAY = "alipay";
    public static String WECHAT = "weChat";

    public int getResult() {
        return this.result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public String getNumber() {
        return this.number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public double getPayAmount() {
        return this.payAmount;
    }

    public void setPayAmount(double payAmount) {
        this.payAmount = payAmount;
    }

    public int getReceiptType() {
        return this.receiptType;
    }

    public void setReceiptType(int receiptType) {
        this.receiptType = receiptType;
    }

    public List<String> getChannel() {
        return channel;
    }

    public void setChannel(List<String> channel) {
        this.channel = channel;
    }

    // [ "alipay", "weChat" ]
    public boolean hasAliPay(){
        if (channel != null && channel.size() > 0){
            int size = channel.size();
            for (int i=0;i<size;i++){
                String s = channel.get(i);
                if (ALIPAY.equals(s)){
                    return true;
                }
            }
        }
        return false;
    }
    public boolean hasWeChatPay(){
        if (channel != null && channel.size() > 0){
            int size = channel.size();
            for (int i=0;i<size;i++){
                String s = channel.get(i);
                if (WECHAT.equals(s)){
                    return true;
                }
            }
        }
        return false;
    }
}
